﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ExcelSystem.Migrations
{
    /// <inheritdoc />
    public partial class Created : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Orders",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Company = table.Column<int>(type: "int", nullable: false),
                    OrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderLine = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Factory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProcurementTypePar = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SchedulingNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ElevatorType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ConstructionSiteModule = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BoxName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SchedulingDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    NamePlate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PackagingBoxStatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShaftWidth = table.Column<double>(type: "float", nullable: true),
                    ShaftDepth = table.Column<double>(type: "float", nullable: true),
                    distance = table.Column<double>(type: "float", nullable: true),
                    distance4 = table.Column<double>(type: "float", nullable: true),
                    CarRoofWheelArrange = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutsourcingSize = table.Column<double>(type: "float", nullable: true),
                    distance2 = table.Column<double>(type: "float", nullable: true),
                    ShaftWallThickness = table.Column<double>(type: "float", nullable: true),
                    HallDoorSpace = table.Column<double>(type: "float", nullable: true),
                    BoxPrinting = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    distance3 = table.Column<double>(type: "float", nullable: true),
                    CounterweightArrange = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HostSeries = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BearingBeamAngle = table.Column<double>(type: "float", nullable: true),
                    CounterweightWheelDameter = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OuterDepth = table.Column<double>(type: "float", nullable: true),
                    distance5 = table.Column<double>(type: "float", nullable: true),
                    distance6 = table.Column<double>(type: "float", nullable: true),
                    CounterWeightShaftDepth = table.Column<double>(type: "float", nullable: true),
                    PulleyDiameter = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CarOuterWidth = table.Column<double>(type: "float", nullable: true),
                    Load = table.Column<double>(type: "float", nullable: true),
                    Spped = table.Column<double>(type: "float", nullable: true),
                    DoorsOpenedNo = table.Column<double>(type: "float", nullable: true),
                    StopsNo = table.Column<double>(type: "float", nullable: true),
                    distance7 = table.Column<double>(type: "float", nullable: true),
                    SpeedLimiterPosition = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SteelWireRopesNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExportElevator = table.Column<bool>(type: "bit", nullable: false),
                    MaterialNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialDescribe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<double>(type: "float", nullable: true),
                    Unit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    MaterialSpecifications = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BOMSpecifications = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TTBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SequenceNumber = table.Column<double>(type: "float", nullable: true),
                    Remarks = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CustomType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Color = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDeteleted = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Orders", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Material",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderLine = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BOMLevel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialDescribe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RawMaterials = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Number = table.Column<double>(type: "float", nullable: true),
                    Unit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProcurementTypePar = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProductionPar = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Color = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    L = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkSize = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NetWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GrossWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Direction = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialSpecifications = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BOMSpecifications = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remarks = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderID = table.Column<int>(type: "int", nullable: true),
                    IsDeteleted = table.Column<bool>(type: "bit", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Material", x => x.ID);
                    table.ForeignKey(
                        name: "FK_Material_Orders_OrderID",
                        column: x => x.OrderID,
                        principalTable: "Orders",
                        principalColumn: "ID");
                });

            migrationBuilder.CreateIndex(
                name: "IX_Material_OrderID",
                table: "Material",
                column: "OrderID");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Material");

            migrationBuilder.DropTable(
                name: "Orders");
        }
    }
}
